{{ template "hrefhack" . }}
{{ $version := .File.Dir }}
{{ if in $version "about_openeuler" }}
    {{ with .Site.GetPage "/about_openeuler/menu"}}
    {{- .Content -}}
    {{ end }}
{{ else if in $version "summitfaq" }}
    {{ with .Site.GetPage "/summitfaq/menufaq"}}
    {{- .Content -}}
{{ end }}
{{ else }}
    {{ $versionArr := split $version "docs" }}
    {{ $versionArr := index $versionArr 1 }}
    {{ $versionArr := split $versionArr "/" }}
    {{ $versionArr := index $versionArr 1 }}
    {{ $versionArr := string $versionArr }}
    {{ $versionArr := delimit (slice "docs" $versionArr) "/"}}
    {{ $versionArr := delimit (slice $versionArr "menu" ) "/"}}
    {{ $versionArr := string $versionArr}}
    {{ with .Site.GetPage $versionArr}}
      {{- .Content -}}
    {{ end }}
{{ end }}


{{ define "hrefhack" }}
  {{ $attrEq := "$=" }}
  {{ $attrVal := .RelPermalink }}
  {{ if eq .RelPermalink "/" }}
    {{ $attrEq = "=" }}       
    {{ $attrVal = .Permalink }}
  {{ end }}

  <style>
  nav ul a[href{{ $attrEq }}"{{ $attrVal }}"] {
      color: {{ default "#004ed0" .Site.Params.BookMenuBundleActiveLinkColor }};
  }
  </style>
{{ end }}
